package com.gc.server.service;

import com.gc.server.entity.UserEntity;
import com.gc.server.vo.ShopVo;
import com.gc.server.vo.UserVo;
import com.yf.service.BaseService;
import org.apache.catalina.User;

import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 用户Service接口
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Tue Mar 10 11:17:45 CST 2020
 */
public interface UserService extends BaseService<UserEntity> {



     List<UserVo> queryListVo(UserVo userVo);

     UserVo getVo(Long id);

    /***********BACK***********/

    /***********API***********/

    /**
     * 通过微信OpenId查找
     * @param openId
     * @return
     */
    UserEntity findByOpenId(String openId);


    UserEntity findByWxId(String wxId);

    /**
     * 注册
     * @param userEntity
     * @return
     */
    UserEntity register(UserEntity userEntity);


    /**
     * 根据上级与
     * @param topId
     * @return
     */
    List<UserEntity> findMyShopUserAndLv(Long topId,Long levelId);

    /**
     * 根据上级查找
     * @param topId
     * @return
     */
    List<UserEntity> findMyShopUser(Long topId);

    List<UserEntity> findChildren(Long topId);

    /**
     * 更新VO
     * @param userVo
     * @return
     */
    UserEntity updateVo(UserVo userVo);

    List<UserEntity> findByPidAndDate(Long pid, Date date);

    UserEntity register(Long pid, String unionId, String openId, String avatar, String name);

    List<Long> findTeam(Long userId);

    Long getAdmin(Long userId);

    void changeVip(List<UserVo> userList);

    UserEntity act(Long userId, Long id);


    List<UserEntity> sumByTop(Long userId, Date startDate, Date endDate, Long uid);

    void downLoad(HttpServletResponse response, List<UserVo> list);
}
